%登录阿里云镜像仓%
docker login --username=carol199064 registry.cn-hangzhou.aliyuncs.com --password=moto9171
set dType=%1
set version=%2
echo %dType%
echo %version%
call:commonInstall


echo "=======construct shell finished====="


%构建整个项目，或者单独构建common项目,避免依赖未被构建上去%
:commonInstall
cd ../xdclass-common
mvn install
goto:eof

%构建网关%
:dockerGateway
cd ../xdclass-gateway
mvn install -Dmaven.test.skip=true dockerfile:build
docker tag xdclass-cloud/xdclass-gateway:latest registry.cn-shenzhen.aliyuncs.com/1024-cloud/api-gateway:v1.2
docker push registry.cn-shenzhen.aliyuncs.com/1024-cloud/api-gateway:v1.2
echo "网关构建推送成功"
:goto:eof


%用户服务%
:dockerUser
cd ../xdclass-user-service
mvn install -Dmaven.test.skip=true dockerfile:build
docker tag xdclass-cloud/xdclass-user-service:latest registry.cn-shenzhen.aliyuncs.com/1024-cloud/xdclass-user-service:v1.2
docker push registry.cn-shenzhen.aliyuncs.com/1024-cloud/xdclass-user-service:v1.2
echo "用户服务构建推送成功"
:goto:eof


%商品服务%
:dockerProduct
cd ../xdclass-product-service
mvn install -Dmaven.test.skip=true dockerfile:build
docker tag xdclass-cloud/xdclass-product-service:latest registry.cn-shenzhen.aliyuncs.com/1024-cloud/xdclass-product-service:v1.2
docker push registry.cn-shenzhen.aliyuncs.com/1024-cloud/xdclass-product-service:v1.2
echo "商品服务构建推送成功"
:goto:eof


%订单服务%
:dockerProduct
cd ../xdclass-order-service
mvn install -Dmaven.test.skip=true dockerfile:build
docker tag xdclass-cloud/xdclass-order-service:latest registry.cn-shenzhen.aliyuncs.com/1024-cloud/xdclass-order-service:v1.2
docker push registry.cn-shenzhen.aliyuncs.com/1024-cloud/xdclass-order-service:v1.2
echo "订单服务构建推送成功"
:goto:eof


%优惠券服务%
:dockerCoupon
cd ../xdclass-coupon-service
mvn install -Dmaven.test.skip=true dockerfile:build
docker tag xdclass-cloud/xdclass-coupon-service:latest registry.cn-shenzhen.aliyuncs.com/1024-cloud/xdclass-coupon-service:v1.2
docker push registry.cn-shenzhen.aliyuncs.com/1024-cloud/xdclass-coupon-service:v1.2
echo "优惠券服务构建推送成功"
:goto:eof

